package com.zzx.test.singleton;

/**
 * @Author ZhouZhiXin
 * @ClassName HungryMan
 * @Description Description Write Here.
 * @Date 2020/11/7
 * @Time 23:03
 */
public class HungryMan {

    /**
     * 定义静态常量指向唯一实例
     */
    private static final HungryMan instance = new HungryMan();

    /**
     * 构造方法私有，禁止别人访问
     */
    private HungryMan() {};

    /**
     * 通过静态方法来获取唯一实例
     *
     * @return
     */
    public static HungryMan getInstance() {
        return instance;
    }
}

